package biz.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import dao.EmployeeDao;

import entity.Employee;
import biz.EmployeeBiz;

@Service
public class EmployeeBizImpl implements EmployeeBiz {
	@Resource
	private EmployeeDao dao;
	
	@Override
	public Employee login(String loginid, String pwd) {
		Employee emp=dao.login(loginid, pwd);
		if(emp!=null){
			//更新最后登录时间
			dao.updateLasttime(emp.getEmpid());
		}
		return emp;
	}

	@Override
	public boolean add(Employee e) {
		// TODO Auto-generated method stub
		return dao.add(e);
	}

	@Override
	public boolean del(int id) {
		// TODO Auto-generated method stub
		return dao.del(id);
	}

	@Override
	public Employee get(int id) {
		// TODO Auto-generated method stub
		return dao.get(id);
	}

	@Override
	public List<Employee> queryByPage(int page, int rows) {
		// TODO Auto-generated method stub
		return dao.queryByPage(page, rows);
	}

	@Override
	public boolean update(Employee e) {
		// TODO Auto-generated method stub
		return dao.update(e);
	}

	@Override
	public int count() {
		// TODO Auto-generated method stub
		return dao.count();
	}



}
